package com.sls.nzdapplication.model;

import com.alibaba.fastjson.JSONObject;

import org.greenrobot.greendao.annotation.Entity;
import org.greenrobot.greendao.annotation.Generated;
import org.greenrobot.greendao.annotation.Id;

import java.util.Date;

@Entity
public class Gyyhd {
    @Id
    private String id;

    private String name;

    private double lat;

    private double lon;

    private String type;

    private String areaId;

    private Date createTime;

    private String createBy;

    private Date modifyTime;

    private String modifyBy;

    @Generated(hash = 486020746)
    public Gyyhd(String id, String name, double lat, double lon, String type,
            String areaId, Date createTime, String createBy, Date modifyTime,
            String modifyBy) {
        this.id = id;
        this.name = name;
        this.lat = lat;
        this.lon = lon;
        this.type = type;
        this.areaId = areaId;
        this.createTime = createTime;
        this.createBy = createBy;
        this.modifyTime = modifyTime;
        this.modifyBy = modifyBy;
    }


    public JSONObject toJson(){
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("id",this.id);
        jsonObject.put("name",this.name);
        jsonObject.put("createTime",this.createTime);
        jsonObject.put("createBy",this.createBy);
        jsonObject.put("modifyTime",this.modifyTime);
        jsonObject.put("type",this.type);
        jsonObject.put("lon",this.lon);
        jsonObject.put("lat",this.lat);
        jsonObject.put("areaId",this.areaId);
        return jsonObject;
    }
    public Gyyhd(JSONObject jsonObject){
        this.id = jsonObject.getString("id");
        this.name = jsonObject.getString("name");
        this.createTime = jsonObject.getDate("createTime");
        this.createBy = jsonObject.getString("createBy");
        this.modifyTime = jsonObject.getDate("modifyTime");
        this.modifyBy = jsonObject.getString("modifyBy");
        this.type = jsonObject.getString("type");
        this.lon = jsonObject.getDouble("lon");
        this.lat = jsonObject.getDouble("lat");
        this.areaId = jsonObject.getString("areaId")==null?"":jsonObject.getString("areaId");
    }

    @Generated(hash = 1174474960)
    public Gyyhd() {
    }

    public String getId() {
        return this.id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getLat() {
        return this.lat;
    }

    public void setLat(double lat) {
        this.lat = lat;
    }

    public double getLon() {
        return this.lon;
    }

    public void setLon(double lon) {
        this.lon = lon;
    }

    public String getType() {
        return this.type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getAreaId() {
        return this.areaId;
    }

    public void setAreaId(String areaId) {
        this.areaId = areaId;
    }

    public Date getCreateTime() {
        return this.createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getCreateBy() {
        return this.createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public Date getModifyTime() {
        return this.modifyTime;
    }

    public void setModifyTime(Date modifyTime) {
        this.modifyTime = modifyTime;
    }

    public String getModifyBy() {
        return this.modifyBy;
    }

    public void setModifyBy(String modifyBy) {
        this.modifyBy = modifyBy;
    }
}
